/**
 * @author david
 */
  $(function(){  
    $('#tabs').tabs({ fxSlide: true, fxFade: true, fxSpeed: 'fast' });
				
				// Dialog Link
				
	//hover states on the static widgets
				$('#dialog_link_1, #dialog_link_2, #salida, ul#icons li').hover(
					function() { $(this).addClass('ui-state-hover'); }, 
					function() { $(this).removeClass('ui-state-hover'); }
				);
				
	//$("#ingreso0 #ingreso1 #ingreso2 #ingreso3 #ingreso4 #ingreso5").tooltip({
	$("span").tooltip({
	track: true,
	delay: 0,
	showURL: false,
	fixPNG: true,
	showBody: " - ",
	extraClass: "pretty fancy",
	top: -15,
	left: 5
});

    $("#salida0 #salida1 #salida2 #salida3 #salida4 #salida5").tooltip({
	track: true,
	delay: 0,
	showURL: false,
	showBody: " - ",
	extraClass: "pretty",
	fixPNG: true,
	left: -120
});

  });
  
     $('#contactLink').click(function(){
                    if ($('#contactForm').is(':hidden')){
                        $('#contactForm').slideDown('slow');
                    }
                    else{
                        $('#contactForm').slideUp('slow');
                    }
                });
 
            function closeForm(){
                $('#messageSent').show('slow');
                setTimeout("$('#messageSent').hide();$('#contactForm').slideUp('slow')", 2000);
                
           }
   $(function(){
		//all hover and click logic for buttons
		$(".fg-button:not(.ui-state-disabled)")
		.hover(
			function(){ 
				$(this).addClass("ui-state-hover"); 
			},
			function(){ 
				$(this).removeClass("ui-state-hover"); 
			}
		)
		.mousedown(function(){
				$(this).parents('.fg-buttonset-single:first').find(".fg-button.ui-state-active").removeClass("ui-state-active");
				if( $(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
				else { $(this).addClass("ui-state-active"); }	
		})
		.mouseup(function(){
			if(! $(this).is('.fg-button-toggleable, .fg-buttonset-single .fg-button,  .fg-buttonset-multi .fg-button') ){
				$(this).removeClass("ui-state-active");
			}
		});
	});
	
	
	     $('#ingreso').click(function(){
	     	        alert("ingreso");
                    /*if ($('#contactForm').is(':hidden')){
                        $('#contactForm').slideDown('slow');
                    }
                    else{
                        $('#contactForm').slideUp('slow');
                    }*/
                });